<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<%@ taglib uri="/WEB-INF/tlds/att.tld" prefix="att"%>
<html>
<head>
	<meta name="decorator" content="moduleEdit" />
	<link rel="stylesheet" href="${staticPath}/lib/ztree/3.5/css/zTreeStyle/zTreeStyle.css" type="text/css">
	<script src="${staticPath}/lib/ztree/3.5/js/jquery.ztree.all-3.5.js" type="text/javascript"></script>
	<script src="${staticPath}/js/jquery-dialog.js" type="text/javascript"></script>
	<script type="text/javascript">
		$(document).ready(function() { 
			//$("#brandCname").focus();
			$("#brandCateForm").validate({
				submitHandler: function(form){
					//品牌风格checked
					setCheckedIds("brand_style","#brandCust_brandStyle");
					//收入层checked
					setCheckedIds("income_level","#brandCust_incomeLevel");
					//年龄层checked
					setCheckedIds("age_level","#brandCust_ageLevel");
					Oosp_Loading('正在提交，请稍等...');
					form.submit();
				},
				errorContainer: "#messageBox",
				errorPlacement: function(error, element) {
					$("#messageBox").text("输入有误，请先更正。");
					if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
						error.appendTo(element.parent().parent());
					} else {
						error.insertAfter(element);
					}
				}
				
			});
			//选择招商分类
			var opt = {
					idField : "cateId",
					nameField : "cate_cateName",
					multiple : false,
					service : "selectCMCateDataService",
					title: "招商分类"
				};
			$("#cmCateDialogMultiple").Dialog(opt);
			 
		});
		
		var max_tr = $("#hidden_tr").closest("table").find("tr").length - 1;
		//添加隐藏域
		function add_hidden(tId,tList) 
		{
			var tr = $(tId).clone();
			var table = $(tId).closest("table");
			//替换所有的hidden，方便spring的form绑定
			var inputs = tr.find("input");
			max_tr++;
			inputs.each(function() {
				this.id = tList + max_tr + this.id;
				this.name = tList+"[" + max_tr + "]" + this.name;
				if($("#sequence")!=null)
				{ 
					$("#sequence").html(max_tr+2);
				}
			});
			tr.show();
			table.append(tr);
		}
		function delete_tr(t,dList) 
		{
			var tr=$(t).closest("tr");
			var id=tr.find("input :first").val();
			if(id!=0){
				var val=$(dList).val();
				if(val==""){
					$(dList).val(id);
				}else{
					$(dList).val(val+","+id);
				}
			}
			tr.remove();
		}
		function setCheckedIds(vname,vid)
		{
			var str = "";
			$("input[name="+vname+"]:checked").each(function(i){
				str+=this.value+"##";
			});
			str = str.substring(0,str.length-2);
			$(vid).val(str);
		}
	</script>
<style type="text/css">
h4{ border-bottom:1px dotted #ccc; padding-bottom:10px; margin:30px 0 15px; color:#b12028; font-size: 12px;}
</style>
</head>
<body>
	<div class="panel panel-default">
		  <div class="panel-heading">
		    <h3 class="panel-title">品牌准入
		    <a class="btn btn-default btn-sm pull-right o-a-button" role="button" href="javascript:void(0)" onclick="history.go(-1)">返回</a>
		    </h3>
		  </div>
		  <div class="panel-body">
			<form:form id="brandCateForm" name="brandCateForm" enctype="multipart/form-data" modelAttribute="brandCate" action="${contextPath}/biz/brand/brandcate/save" method="post" class="form-horizontal" role="form">
				<form:hidden path="id"/>
				<form:hidden path="cateId"/>
				<form:hidden path="brandId"/>
				<tags:message content="${message}"/>
				<h4>基本信息</h4>
				<form:hidden path="brand.id"/>
				<form:hidden path="brand.brandNo"/>
				<div class="form-group">
					<label for="cate_cateName" class="col-sm-3 control-label">招商分类:</label>
					<span class="span-required">*</span>
					<div class="col-sm-4">
						<div class="input-group">
						<input type="text" class="form-control" id="cate_cateName" placeholder="请选择招商分类" readonly="readonly" class="form-control required">
				 		  <span class="input-group-btn">
					        <button class="btn btn-primary" id="cmCateDialogMultiple" type="button">
					        	选择
					        </button>
					      </span>
						</div>
					</div>
				</div>
				<div class="form-group">
					<label for="brand.brandCname" class="col-sm-3 control-label">品牌中文名:</label>
					<span class="span-required">*</span>
					<div class="col-sm-4">
						<form:input id="brand_brandCname"  path="brand.brandCname" placeholder="请输入品牌中文名"  maxlength="150"  class="form-control required"/>
					</div>
				</div>
				<div class="form-group">
					<label for="brand.brandEname" class="col-sm-3 control-label">品牌英文名:</label>
					<span class="span-required">*</span>
					<div class="col-sm-4">
						<form:input id="brand_brandEname" path="brand.brandEname" placeholder="请输入品牌英文名" maxlength="100"  class="form-control required"/>
					</div>
				</div>
				<div class="form-group">
					<label for="attachArea" class="col-sm-3 control-label">品牌归属地:</label>
					<div class="col-sm-4">
						<form:input id="brand_attachArea" path="attachArea" maxlength="20" class="form-control required"/>
					</div>
				</div>
				<div class="form-group">
					<label for="makeArea" class="col-sm-3 control-label">商品产地:</label>
					<div class="col-sm-4">
						<form:input id="brand_makeArea" path="makeArea" maxlength="20" class="form-control required"/>
					</div>
				</div>
				<div class="form-group">
				<span class="span-required">*</span>
					<label for="brand_logo" class="col-sm-3 control-label">品牌Logo:</label>
					<div class="col-sm-4">
						<input type="file" name="brand_logo">
					</div>
				</div>
				<div class="form-group">
					<label for="inMarketYear" class="col-sm-3 control-label">品牌进入市场日期:</label>
					<div class="col-sm-4">
					 <div class="input-group date form_date" data-date="" data-date-format="yyyy-mm-dd" >
						<input id="brand_inMarketYear" readonly="readonly" placeholder="请选择日期" name="inMarketYear" type="text"  class="form-control required"
							value="<fmt:formatDate value="${brandCate.inMarketYear}" pattern="yyyy-MM-dd"/>"/>
						<span class="input-group-addon"><span class="glyphicon glyphicon-remove"></span></span>
		                 <span class="input-group-addon"><span class="glyphicon glyphicon-calendar"></span></span>
	                 </div>
                 	</div>
				</div>
				<div class="form-group">
					<label for="marketYear" class="col-sm-3 control-label">品牌市场经营年限:</label>
					<div class="col-sm-4">
					<div class="input-group">
						<form:input id="brand_marketYear" path="marketYear" maxlength="20" class="form-control required"/>
					  	<span class="input-group-addon">年</span>
						</div>
					</div>
				</div>
				<div class="form-group">
					<label for="companyName" class="col-sm-3 control-label">所属公司名称:</label>
					<div class="col-sm-4">
						<form:input id="brand_companyName" path="companyName" maxlength="30" class="form-control required"/>
					</div>
				</div>
				<div class="form-group">
					<label for="company_contacts" class="col-sm-3 control-label">所属公司联系人:</label>
					<div class="col-sm-4">
						<form:input id="company_contacts" path="companyContacts" maxlength="30" class="form-control required"/>
					</div>
				</div>
				<div class="form-group">
   					<label for="levelId" class="col-sm-3 control-label">品牌等级:</label>
				    <div class="col-sm-4">
				      <form:select id="levelId" path="levelId" class="form-control required">
					      <c:forEach items="${levelList}" var="item">
							<form:option value="${item.id}">${item.levelName}</form:option>
						  </c:forEach>
				      </form:select>
					</div>
				</div>
				<div class="form-group">
   					<label for="brand.status" class="col-sm-3 control-label">品牌状态:</label>
   					<span class="span-required">*</span>
				    <div class="col-sm-4">
				      <ossp:select dictType="brandStatus" defaultSelected="${ brandCate.status}" name="brand.status"id="brand_status" class_="form-control"></ossp:select>
				    </div>
				</div>
				<div class="form-group">
   					<label for="brand_isTargetBrand" class="col-sm-3 control-label">是否目标战略品牌:</label>
				    <div class="col-sm-4">
				    	<form:radiobutton path="isTargetBrand" value="1" label="是"/>
				    	<form:radiobutton path="isTargetBrand" value="0" label="否"/>
				    </div>
				</div>
				<div class="form-group">
   					<label for="reporterIdentity" class="col-sm-3 control-label">提报人身份:</label>
				    <div class="col-sm-4">
				      <ossp:select dictType="brandReporterId" name="reporterIdentity"id="brand_reporterIdentity" class_="form-control"></ossp:select>
				    </div>
				</div>
				<div class="form-group">
					<label for="reporter" class="col-sm-3 control-label">提报人:</label>
					<div class="col-sm-4">
						<form:input id="brand_reporter" path="reporter" maxlength="20" class="form-control required"/>
					</div>
				</div>
				<div class="form-group">
					<label for="reportDate" class="col-sm-3 control-label">提报日期:</label>
					<div class="col-sm-4">
					 <div class="input-group date form_date" data-date="" data-date-format="yyyy-mm-dd" >
						<input id="brand_reportDate" placeholder="请输入日期" readonly="readonly" name="reportDate" type="text"  class="form-control required"
							value="<fmt:formatDate value="${brandCate.reportDate}" pattern="yyyy-MM-dd"/>"/>
						<span class="input-group-addon"><span class="glyphicon glyphicon-remove"></span></span>
		                 <span class="input-group-addon"><span class="glyphicon glyphicon-calendar"></span></span>
	                 </div>
                 	</div>
				</div>
				<div class="form-group">
					<label for="brandSummary" class="col-sm-3 control-label">品牌简介:</label>
					<div class="col-sm-6">
						<form:textarea id="brand_brandSummary" path="brandSummary" class="form-control"  maxlength="1000"/>
					</div>
				</div>
				<h4>商标注册信息</h4>
				<div class="form-group">
					<label for="holder" class="col-sm-3 control-label">注册人:</label>
					<div class="col-sm-4">
						<form:input id="brand_holder" path="holder" placeholder="请输入商标注册人" maxlength="20" class="form-control required"/>
					</div>
				</div>
				<div class="form-group">
					<label for="brandRegisterNo" class="col-sm-3 control-label">商标注册证号:</label>
					<span class="span-required">*</span>
					<div class="col-sm-4">
						<form:input id="brand_brandRegisterNo" placeholder="请输入商标注册证号" path="brandRegisterNo" maxlength="30" class="form-control required"/>
					</div>
				</div>
				<div class="form-group">
					<label for="registerArea" class="col-sm-3 control-label">注册地址:</label>
					<div class="col-sm-4">
						<form:input id="brand_registerArea" path="registerArea"  maxlength="20" class="form-control required"/>
					</div>
				</div>
				<div class="form-group">
					<label for="brand_registerDate" class="col-sm-3 control-label">注册证有效期:</label>
					<div class="col-sm-8">
					<div class="input-group">
						 <div class="input-group date form_date" data-date="" data-date-format="yyyy-mm-dd" >
							<input id="brand_registerStartDate" placeholder="起始日期" readonly="readonly" name="registerStartDate" type="text"  class="form-control required"
								value="<fmt:formatDate value="${brandCate.registerStartDate}" pattern="yyyy-MM-dd"/>"/>
							<span class="input-group-addon"><span class="glyphicon glyphicon-remove"></span></span>
			                <span class="input-group-addon"><span class="glyphicon glyphicon-calendar"></span></span>
		                 </div>
		                 <span class="input-group-addon">至</span>
		                  <div class="input-group date form_date" data-date="" data-date-format="yyyy-mm-dd" >
							<input id="brand_registerEndDate" placeholder="截止日期" readonly="readonly" name="registerEndDate" type="text"  class="form-control required"
								value="<fmt:formatDate value="${brandCate.registerEndDate}" pattern="yyyy-MM-dd"/>"/>
							<span class="input-group-addon"><span class="glyphicon glyphicon-remove"></span></span>
			                <span class="input-group-addon"><span class="glyphicon glyphicon-calendar"></span></span>
		                 </div>
		              </div>
                 	</div>
				</div>
				<div class="form-group">
				<span class="span-required">*</span>
					<label for="brandRegisterNo" class="col-sm-3 control-label">商标注册证电子版:</label>
					<div class="col-sm-4">
						<input type="file" name="brand_Register">
					</div>
				</div>
				<h4>品牌市场地位分析</h4>
				<form:hidden path="brandMarket.id"/>
				<form:hidden path="brandMarket.brandCateId"/>
				<div class="form-group">
					<label for="brandMarket.advantage" class="col-sm-3 control-label">优势:</label>
					<div class="col-sm-6">
						<form:textarea id="brandMarket_advantage" path="brandMarket.advantage" class="form-control"  maxlength="1000"/>
					</div>
				</div>
				<div class="form-group">
					<label for="brandMarket.disadvantage" class="col-sm-3 control-label">劣势:</label>
					<div class="col-sm-6">
						<form:textarea id="brandMarket.disadvantage" path="brandMarket.disadvantage" class="form-control"  maxlength="1000"/>
					</div>
				</div>
				
				<h4>竞争品牌
				 <input onclick="add_hidden('#hidden_tr','brandCompeteList');" type="button"
										class="btn btn-success btn-sm pull-right" value="添加"></input>
				</h4>
				<!-- 新增明细 -->
					<table class="table table-striped table-hover o-l-table" id="table1">
					<tbody>
						<c:forEach items="${brandCate.brandCompeteList}" varStatus="var">
							<tr>
								<form:hidden path="brandCompeteList[${var.index}].id" maxlength="20"
									class="form-control required" />
								<form:hidden path="brandCompeteList[${var.index}].brandCateId" maxlength="20"
									class="form-control required" />
								<td>${var.index+1}</td>
								<td>
								<div class="form-group">
									<span class="span-required">*</span>
									<label for="_brandName" class="col-sm-4 control-label">品牌名称:</label>
									<div class="col-sm-6">
										<form:input path="brandCompeteList[${var.index}].brandName"
										maxlength="20" class="form-control required" />
									</div>
								</div>
							</td>
							<td>
								<div class="form-group">
									<label for="_brandName" class="col-sm-3 control-label">等级:</label>
									<div class="col-sm-4">
										<form:input path="brandCompeteList[${var.index}].brandLevel"
										maxlength="20" class="form-control" />
									</div>
								</div>
							</td>
							<td><input type="button" onclick="delete_tr(this,'#delCompetedIds')"
									value="删除" class="btn btn-default btn-sm"></input></td>
							</tr>
						</c:forEach>
						<!-- 隐藏行，用于新增明细start -->
						<tr style="display: none" id="hidden_tr">
							<input type="hidden" maxlength="20" value="0"
								class="form-control required" name=".id" id=".id"/>
							<input type="hidden" maxlength="20" value="${brandCate.id}"
								class="form-control required" name=".brandCateId" id=".brandCateId"/>
							<td><span id="sequence">1</span></td>
							<td>
								<div class="form-group">
									<span class="span-required">*</span>
									<label for="_brandName" class="col-sm-4 control-label">品牌名称:</label>
									<div class="col-sm-6">
										<input type="text" maxlength="20" value=""
										class="form-control required" name=".brandName" id=".brandName"/>
									</div>
								</div>
							</td>
							<td>
								<div class="form-group">
									<label for="_brandName" class="col-sm-3 control-label">等级:</label>
									<div class="col-sm-4">
										<input type="text" maxlength="20" value=""
										class="form-control" name=".brandLevel" id=".brandLevel"/>
									</div>
								</div>
							</td>
							<td><input type="button" onclick="delete_tr(this,'#delCompetedIds')"
								value="删除" class="btn btn-default btn-sm"/></td>
						</tr>
						<!-- 隐藏行，用于新增明细end -->
						<input type="hidden" name="delCompetedIds" id="delCompetedIds"/>
					</tbody>
				</table>
				<h4>品牌市场定位</h4>
				<form:hidden path="brandCust.id"/>
				<form:hidden path="brandCust.brandCateId"/>
				<form:hidden path="brandCust.brandStyle" id="brandCust_brandStyle"/>
				<form:hidden path="brandCust.incomeLevel" id="brandCust_incomeLevel"/>
				<form:hidden path="brandCust.ageLevel" id="brandCust_ageLevel"/>
				 <div class="form-group">
					<label for="brandCust.brandStyle" class="col-sm-3 control-label">品牌风格:</label>
					<div class="col-sm-6">
						<c:forEach items="${styleList}" var="item" varStatus="status">
								<input type="checkbox" name= "brand_style" 
										<c:forEach items="${brandCust.styleList}" var="itemEd" varStatus="status2">
											<c:if test="${item.styleNo == itemEd}">
												checked="checked"
											</c:if>
										</c:forEach>
								 id="${item.styleNo}" value = "${item.styleNo}"/> ${item.styleName}
						</c:forEach>
					</div>
				</div>
				<div class="form-group">
					<label for="brandCust.publicity" class="col-sm-3 control-label">品牌知名度:</label>
					<div class="col-sm-4">
						<ossp:select dictType="brandPublicity" defaultSelected="${brandCust.publicity }" name="publicity"id="brandCust_publicity" class_="form-control"></ossp:select>
					</div>
				</div> 
				<div class="form-group">
					<label for="brandCust.incomeLevel" class="col-sm-3 control-label">收入层:</label>
					<div class="col-sm-6">
						<c:forEach items="${dictIncomeLevelList}" var="item" varStatus="status">
								<input type="checkbox" name= "income_level" 
										<c:forEach items="${brandCust.incomeLevelList}" var="itemEd" varStatus="status2">
											<c:if test="${item.key == itemEd}">
												checked="checked"
											</c:if>
										</c:forEach>
								 id="${item.key}" value = "${item.key}"/> ${item.value}
						</c:forEach>
					</div>
				</div>
				<div class="form-group">
					<label for="brandCust.ageLevel" class="col-sm-3 control-label">年龄层:</label>
					<div class="col-sm-6">
						<c:forEach items="${dictAgeLevelList}" var="item" varStatus="status">
								<input type="checkbox" name= "age_level" 
										<c:forEach items="${brandCust.ageLevelList}" var="itemEd" varStatus="status2">
											<c:if test="${item.key == itemEd}">
												checked="checked"
											</c:if>
										</c:forEach>
								 id="${item.key}" value = "${item.key}"/> ${item.value}
						</c:forEach>
					</div>
				</div>
				<div class="form-group">
					<label for="brandCust_cusPrice" class="col-sm-3 control-label">客单价:</label>
					<div class="col-sm-4">
						<ossp:select dictType="brandCusPrice" defaultSelected="${brandCust.cusPrice }" name="cusPrice"id="brandCust_cusPrice" class_="form-control"></ossp:select>
					</div>
				</div>
				<div class="form-group">
					<label for="brandCust_monthConsumeOrder" class="col-sm-3 control-label">月消费频次:</label>
					<div class="col-sm-4">
						<ossp:select dictType="brandMonthCsmOrder" defaultSelected="${brandCust.monthConsumeOrder }" name="monthConsumeOrder"id="brandCust_monthConsumeOrder" class_="form-control"></ossp:select>
					</div>
				</div>
				<div class="form-group">
					<label for="brandCust_priceLevel" class="col-sm-3 control-label">商品价格带:</label>
					<div class="col-sm-4">
						<form:input id="brandCust_priceLevel" path="brandCust.priceLevel" maxlength="20" class="form-control required"/>
					</div>
				</div>
				
				<h4>品牌市场定位</h4>
				<form:hidden path="brandCust.id"/>
				<form:hidden path="brandCust.brandCateId"/>
				<form:hidden path="brandCust.brandStyle" id="brandCust_brandStyle"/>
				<form:hidden path="brandCust.incomeLevel" id="brandCust_incomeLevel"/>
				<form:hidden path="brandCust.ageLevel" id="brandCust_ageLevel"/>
				 <div class="form-group">
					<label for="brandCust.brandStyle" class="col-sm-3 control-label">品牌风格:</label>
					<div class="col-sm-6">
						<c:forEach items="${styleList}" var="item" varStatus="status">
								<input type="checkbox" name= "brand_style" 
										<c:forEach items="${brandCate.brandCust.styleList}" var="itemEd" varStatus="status2">
											<c:if test="${item.id == itemEd}">
												checked="checked"
											</c:if>
										</c:forEach>
								 id="${item.id}" value = "${item.id}"/> ${item.styleName}
						</c:forEach>
					</div>
				</div>
				<div class="form-group">
					<label for="brandCust.publicity" class="col-sm-3 control-label">品牌知名度:</label>
					<div class="col-sm-4">
						<ossp:select dictType="brandPublicity" name="brandCust.publicity"id="brandCust_publicity" class_="form-control"></ossp:select>
					</div>
				</div> 
				<div class="form-group">
					<label for="brandCust.incomeLevel" class="col-sm-3 control-label">收入层:</label>
					<div class="col-sm-6">
						<c:forEach items="${dictIncomeLevelList}" var="item" varStatus="status">
								<input type="checkbox" name= "income_level" 
										<c:forEach items="${brandCate.brandCust.incomeLevelList}" var="itemEd" varStatus="status2">
											<c:if test="${item.key == itemEd}">
												checked="checked"
											</c:if>
										</c:forEach>
								 id="${item.key}" value = "${item.key}"/> ${item.value}
						</c:forEach>
					</div>
				</div>
				<div class="form-group">
					<label for="brandCust.ageLevel" class="col-sm-3 control-label">年龄层:</label>
					<div class="col-sm-6">
						<c:forEach items="${dictAgeLevelList}" var="item" varStatus="status">
								<input type="checkbox" name= "age_level" 
										<c:forEach items="${brandCate.brandCust.ageLevelList}" var="itemEd" varStatus="status2">
											<c:if test="${item.key == itemEd}">
												checked="checked"
											</c:if>
										</c:forEach>
								 id="${item.key}" value = "${item.key}"/> ${item.value}
						</c:forEach>
					</div>
				</div>
				<div class="form-group">
					<label for="brandCust_cusPrice" class="col-sm-3 control-label">客单价:</label>
					<div class="col-sm-4">
						<form:input id="brandCust_cusPrice" path="brandCust.cusPrice" maxlength="20" class="form-control required"/>
					</div>
				</div>
				<div class="form-group">
					<label for="brandCust_monthConsumeOrder" class="col-sm-3 control-label">月消费频次:</label>
					<div class="col-sm-4">
						<form:input id="brandCust_monthConsumeOrder" path="brandCust.monthConsumeOrder" maxlength="20" class="form-control required"/>
					</div>
				</div>
				<div class="form-group">
					<label for="brandCust_priceLevel" class="col-sm-3 control-label">商品价格带:</label>
					<div class="col-sm-4">
						<form:input id="brandCust_priceLevel" path="brandCust.priceLevel" maxlength="20" class="form-control required"/>
					</div>
				</div>
				<h4>市场占有率
				 <input  onclick="add_hidden('#hidden_tr','brandMktshares');" type="button"
										class="btn btn-success btn-sm pull-right" value="新增"></input>
				 <!--<a href="javascript:add_hidden();" class="pull-right">新增</a> -->
				</h4>
				<!-- 新增明细 -->
					<table class="table table-striped table-hover o-l-table" id="table1">
						<thead>
						<tr>
							<th>序号</th>
							<th>区域</th>
							<th>省份</th>
							<th>城市</th>
							<th>商场</th>
							<th>商场业态</th>
							<th>楼层</th>
							<th>专柜位置</th>
							<th>合作方式</th>
							<th>经营面积(实用)</th>
							<th>月均销售</th>
						</tr>
					</thead>
					<tbody>
						<c:forEach items="${brandCate.brandMktshares}" varStatus="var">
							<tr>
								<form:hidden path="brandMktshares[${var.index}].id" maxlength="20"
									class="form-control required" />
								<form:hidden path="brandMktshares[${var.index}].brandCateId" maxlength="20"
									class="form-control required" />
								<td>${var.index+1}</td>
								<td><form:input path="brandMktshares[${var.index}].regionNo"
										maxlength="20" class="form-control required" /></td>
								<td><form:input path="brandMktshares[${var.index}].provinceNo"
										maxlength="20" class="form-control required" /></td>
								<td><form:input path="brandMktshares[${var.index}].cityNo"
										maxlength="20" class="form-control required" /></td>
								<td><form:input path="brandMktshares[${var.index}].companyNo"
								maxlength="20" class="form-control required" /></td>
								<td><form:input path="brandMktshares[${var.index}].marketType"
										maxlength="20" class="form-control required" /></td>
								<td><form:input path="brandMktshares[${var.index}].floor"
										maxlength="20" class="form-control required" /></td>
								<td><form:input path="brandMktshares[${var.index}].specialPosition"
										maxlength="20" class="form-control required" /></td>
								<td><form:input path="brandMktshares[${var.index}].cooperateMode"
										maxlength="20" class="form-control required" /></td>
								<td><form:input path="brandMktshares[${var.index}].operateArea"
										maxlength="20" class="form-control required" /></td>
								<td><form:input path="brandMktshares[${var.index}].sellCondition"
										maxlength="20" class="form-control required" /></td>
								<td><input type="button" onclick="delete_tr(this,'#deleteList')"
									value="删除" class="btn btn-default btn-sm"></input></td>
							</tr>
						</c:forEach>
						<!-- 隐藏行，用于新增明细start -->
						<tr style="display: none" id="hidden_tr">
							<input type="hidden" maxlength="20" value="0"
								class="form-control required" name=".id" id=".id"/>
							<input type="hidden" maxlength="20" value="${brandCate.id}"
								class="form-control required" name=".brandCateId" id=".brandCateId"/>
							<td><span id="sequence">1</span></td>
							<td><input type="text" maxlength="20" value=""
								class="form-control required" name=".regionNo" id=".regionNo"/></td>
							<td><input type="text" maxlength="20" value=""
								class="form-control required" name=".provinceNo" id=".provinceNo"/></td>
							<td><input type="text" maxlength="20" value=""
								class="form-control" name=".cityNo" id=".cityNo"/></td>
							<td><input type="text" maxlength="20" value=""
								class="form-control" name=".companyNo" id=".companyNo"/></td>
							<td><input type="text" maxlength="20" value=""
								class="form-control" name=".marketType" id=".marketType"/></td>
							<td><input type="text" maxlength="20" value=""
								class="form-control" name=".floor" id=".floor"/></td>
							<td><input type="text" maxlength="20" value=""
								class="form-control" name=".specialPosition" id=".specialPosition"/></td>
							<td><input type="text" maxlength="20" value=""
								class="form-control" name=".cooperateMode" id=".cooperateMode"/></td>
							<td><input type="text" maxlength="20" value=""
								class="form-control" name=".operateArea" id=".operateArea"/></td>
							<td><input type="text" maxlength="20" value=""
								class="form-control" name=".sellCondition" id=".sellCondition"/></td>
							<td><input type="button" onclick="delete_tr(this,'#deleteList')"
								value="删除" class="btn btn-default btn-sm"/></td>
						</tr>
						<!-- 隐藏行，用于新增明细end -->
						<input type="hidden" name="deleteList" id="deleteList"/>
					</tbody>
				</table>
				<form:hidden path="brandAttr.id"/>
				<form:hidden path="brandAttr.brandCateId"/>
				<div class="form-group">
					<label for="brandAttr_shopNumber" class="col-sm-3 control-label">全国门店数总计:</label>
					<div class="col-sm-4">
					  <form:input id="brandAttr_shopNumber" path="brandAttr.shopNumber" maxlength="30" class="form-control required"/>
					</div>
				</div>
				<div class="form-group">
					<label for="brandAttr_salesTotal" class="col-sm-3 control-label">全国销售业绩总计:</label>
					<div class="col-sm-4">
					  <form:input id="brandAttr_salesTotal" path="brandAttr.salesTotal" maxlength="30" class="form-control required"/>
					</div>
				</div>
				<!-- 新增明細end -->
				<h4>合作需求</h4>
				<form:hidden path="brandDemand.id"/>
				<form:hidden path="brandDemand.brandCateId"/>
				<div class="form-group">
					<label for="brandDemand.operateArea" class="col-sm-3 control-label">经营面积(实用):</label>
					<div class="col-sm-4">
					<div class="input-group">
					  <form:input id="brandDemand_operateArea" path="brandDemand.operateArea" maxlength="30" class="form-control required"/>
					  <span class="input-group-addon">㎡</span>
					</div>
					</div>
				</div>
				<div class="form-group">
					<label for="brandDemand.specialPosition" class="col-sm-3 control-label">专柜位置:</label>
					<div class="col-sm-4">
					<ossp:select dictType="specialPosition" name="brandDemand.specialPosition"id="brandDemand_specialPosition" class_="form-control"></ossp:select>
					</div>
				</div>
				<div class="form-group">
					<label for="brandDemand.marketLevel" class="col-sm-3 control-label">商场定位:</label>
					<div class="col-sm-4">
						<ossp:select dictType="marketLevel" name="brandDemand.marketLevel"id="brandDemand_marketLevel" class_="form-control"></ossp:select>
					</div>
				</div>
				<div class="form-group">
					<label for="brandDemand.marketType" class="col-sm-3 control-label">商场业态:</label>
					<div class="col-sm-4">
					<ossp:select dictType="marketType" name="brandDemand.marketType"id="brandDemand_marketType" class_="form-control"></ossp:select>
					</div>
				</div>
				<div class="form-group">
					<label for="brandDemand.cooperationYear" class="col-sm-3 control-label">合作年限:</label>
					<div class="col-sm-4">
					<div class="input-group">
					  <form:input id="brandDemand_cooperationYear" path="brandDemand.cooperationYear" maxlength="10" class="form-control required"/>
					  <span class="input-group-addon">年</span>
					</div>
					</div>
				</div>
				<h4>其它基本工程要求</h4>
				<div class="form-group">
					<label for="brandDemand.storeyHigh" class="col-sm-3 control-label">层高要求:</label>
					<div class="col-sm-3">
					<div class="input-group">
					 <form:input id="brandDemand_storeyHigh" path="brandDemand.storeyHigh" maxlength="10" class="form-control required"/>
					  <span class="input-group-addon">MM</span>
					</div>
					</div>
					<label for="brandDemand.drainagePipe" class="col-sm-3 control-label">排水管径:</label>
					<div class="col-sm-3">
						<div class="input-group">
							<span class="input-group-addon">DN</span>
							<form:input id="brandDemand_drainagePipe" path="brandDemand.drainagePipe" maxlength="20" class="form-control required"/>
						</div>
					</div>
				</div>
				<div class="form-group">
					<label for="brandDemand.gas" class="col-sm-3 control-label">燃气:</label>
					<div class="col-sm-3">
						<div class="input-group">
						<form:input id="brandDemand_gas" path="brandDemand.gas" maxlength="10" class="form-control required"/>
						<span class="input-group-addon">M3/H</span>
						</div>
					</div>
					<label for="brandDemand.waterSupplyPipe" class="col-sm-3 control-label">供水管径:</label>
					<div class="col-sm-3">
						<div class="input-group">
							<span class="input-group-addon">DN</span>
							<form:input id="brandDemand_waterSupplyPipe" path="brandDemand.waterSupplyPipe" maxlength="20" class="form-control required"/>
						</div>
					</div>
				</div>
				<div class="form-group">
					<label for="brandDemand.supplyElectricity" class="col-sm-3 control-label">供电:</label>
					<div class="col-sm-3">
						<div class="input-group">
						 <form:input id="brandDemand_supplyElectricity" path="brandDemand.supplyElectricity" maxlength="10" class="form-control required"/>
						  <span class="input-group-addon">KW</span>
						</div>
					</div>
					<label for="brandDemand.sewagePipe" class="col-sm-3 control-label">排污管径:</label>
					<div class="col-sm-3">
						<div class="input-group">
							<span class="input-group-addon">DN</span>
							<form:input id="brandDemand_sewagePipe" path="brandDemand.sewagePipe" maxlength="20" class="form-control required"/>
						</div>
					</div>
				</div>
				<div class="form-group">
					<label for="brandDemand.freshAirPipe" class="col-sm-3 control-label">新风管径:</label>
					<div class="col-sm-5">
						<div class="input-group">
						<form:input id="brandDemand_freshAirPipe" path="brandDemand.freshAirPipe" maxlength="10" class="form-control required"/>
						<span class="input-group-addon">MM*</span>
						<%--<form:input id="brandDemand.freshAirPipe" path="brandDemand.freshAirPipe" maxlength="30" class="form-control required"/>
						<span class="input-group-addon">MM</span>--%>
						</div>
					</div>
				</div>
				<div class="form-group">
					<label for="brandDemand.exhaustAirPipe" class="col-sm-3 control-label">排风管径:</label>
					<div class="col-sm-5">
						<div class="input-group">
						<form:input id="brandDemand_exhaustAirPipe" path="brandDemand.exhaustAirPipe" maxlength="10" class="form-control required"/>
						<span class="input-group-addon">MM*</span>
						<%--<form:input id="brandDemand.exhaustAirPipe" path="brandDemand.exhaustAirPipe" maxlength="30" class="form-control required"/>
						<span class="input-group-addon">MM</span>--%>
						</div>
					</div>
				</div>
				<div class="form-group">
					<label for="brandDemand.smokePipe" class="col-sm-3 control-label">排烟管径:</label>
					<div class="col-sm-5">
						<div class="input-group">
						<form:input id="brandDemand_smokePipe" path="brandDemand.smokePipe" maxlength="10" class="form-control required"/>
						<span class="input-group-addon">MM*</span>
						<%--<form:input id="brandDemand.smokePipe" path="brandDemand.smokePipe" maxlength="30" class="form-control required"/>
						<span class="input-group-addon">MM</span>--%>
						</div>
					</div>
				</div>
				<div class="form-group">
					<label for="brandDemand.airConditgType" class="col-sm-3 control-label">空调:</label>
					<div class="col-sm-6" >
							<div  class="input-group" >
								<span class="input-group-addon">
									<form:radiobutton path="brandDemand.airConditgType" value="1" label="自装空调"/>
						       	 	<form:radiobutton path="brandDemand.airConditgType" value="0" label="使用中央空调" />
						       </span>
								<form:input id="brandDemand.airConditg" path="brandDemand.airConditg" maxlength="30" class="form-control required"/>
								<span class="input-group-addon">KW</span>
							</div>
					</div>
				</div>
				<div class="form-group">
					<label for="brandDemand.oilStType" class="col-sm-3 control-label">隔油池:</label>
					<div class="col-sm-6" >
							<div  class="input-group" >
								<span class="input-group-addon">
						        	<form:radiobutton path="brandDemand.oilStType" value="0" label="公用隔油池" />
						        	<form:radiobutton path="brandDemand.oilStType" value="1" label="独立隔油池"/>
						      	</span>
								<form:input id="brandDemand.oilSeparatingTank" path="brandDemand.oilSeparatingTank" maxlength="30" class="form-control required"/>
								<span class="input-group-addon">M3</span>
							</div>
					</div>
				</div>
				<div class="form-group">
					<label for="brandDemand.other" class="col-sm-3 control-label">其它:</label>
					<div class="col-sm-6">
					<form:textarea id="brandDemand_other" path="brandDemand.other" class="form-control"  maxlength="300"/>
					</div>
				</div>
				<div class="form-group">
				  <div class="col-sm-offset-5 col-sm-10">
				    <input class="btn btn-primary" type="submit" value="保 存"/>
					<input class="btn btn-default" type="button" value="返 回" onclick="history.go(-1)"/>
				  </div>
				</div>
			</form:form>
		  </div>
	</div>
	
	<script type="text/javascript">
	$('.form_date').datetimepicker({
        language:  'zh-CN',
        weekStart: 1,
        todayBtn:  1,
		autoclose: 1,
		todayHighlight: 1,
		startView: 2,
		minView: 2,
		forceParse: 0,
		format: 'yyyy-mm-dd',
		pickerPosition: "bottom-left"
    });
	
	</script>
</body>
</html>